
********************************************************************************
* Name			: Figure 3 - Time and risk preferences between husband and wife
*                 
* Description	: This dofile shows the code used for the figure
********************************************************************************
use dataset_wide.dta, clear
*Time preferences
gen less_patient = 0
replace less_patient = 1 if time_3weeks_share1 < time_3weeks_share0

gen equally_patient = 0
replace equally_patient = 1 if time_3weeks_share1 == time_3weeks_share0

gen more_patient = 0
replace more_patient = 1 if time_3weeks_share1 > time_3weeks_share0

graph bar less_patient equally_patient more_patient, ///
bargap(40) ylabel(,nogrid) legend(label(1 "Husband most patient") label(2 "Equally patient") ///
label(3 "Wife most patient") col(1) size(small) textwidth(35)) ///
ytitle("Fraction", size(medium)) title("Time-preference difference", size(large))

*Risk preferences
gen less_risk = 0
replace less_risk = 1 if risk_invest_share1 < risk_invest_share0

gen equally_risk = 0
replace equally_risk = 1 if risk_invest_share1 == risk_invest_share0

gen more_risk = 0
replace more_risk = 1 if risk_invest_share1 > risk_invest_share0

graph bar less_risk equally_risk more_risk, ///
bargap(40) ylabel(,nogrid)  legend(label(1 "Husband less risk averse") ///
label(2 "Equally risk averse") label(3 "Wife less risk averse")col(1) size(small) textwidth(35)) ///
 title("Risk-preference difference", size(large))
